# from flask import session

from flask_script import Manager
# 数据库迁移的扩展
from flask_migrate import Migrate,MigrateCommand

# 导入info目录下的create_app,db
from info import create_app,db,models

# from flask_sqlalchemy import SQLAlchemy

# from flask_session import Session

# from config import config_dict
# from redis import StrictRedis

# app = Flask(__name__)

# # 使用配置信息
# app.config.from_object(config_dict['development'])

# app.config['DEBUG'] = True
#
# app.config['SECRET_TEY'] = '3k2Zkha7qukmtHpGR4ZsmRz4HyPw2obbS+gKqPxJ'
# app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://root:mysql@localhost/info18'
# app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
#
# app.config['SESSION_TYPE'] = 'redis'
# app.config['SESSION_REDIS'] = StrictRedis(host='127.0.0.1',port=6379)
# app.config['SESSION_USE_SIGNER'] = True
# app.config['PERMANENT_SESSION_LIFETIME'] = 86400

# db = SQLAlchemy(app)

# 调用函数,获取app,传入函数,通过参数的不同,可以获取不同环境下的app
app = create_app('development')

manage = Manager(app)
Migrate(app,db)
manage.add_command('db',MigrateCommand)

# Session(app)



if __name__ == '__main__':
    # app.run(debug=True)
    print(app.url_map)
    manage.run()
